package com.young4j.springdemo.config.event;

import org.springframework.context.ApplicationListener;

/**
 * @Description
 * 监听定义 -- 需要在启动类中注册监听，否则不生效
 * @Author yf
 * @Date 2018/12/26 16:57
 **/
public class BlackListener implements ApplicationListener<BlackEvent> {
    @Override
    public void onApplicationEvent(BlackEvent event) {
        System.out.println("监听到BlackListEvent事件: " + event.getAddress());
        /*try {
            Thread.currentThread().sleep(2000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }*/
    }
}
